import request from '@/utils/request';

/** 活动列表 */
export const GetActivityList = payload =>
  request({
    url: '/committee/activity/list',
    method: 'get',
    params: payload,
  });
/** 导出活动信息 */
export const exportActivity = payload =>
  request({
    url: '/committee/activity/export',
    method: 'post',
    params: payload,
  });

/** 组织列表 */
export const GetOrgList = payload =>
  request({
    url: '/committee/org/assisting',
    method: 'get',
    params: payload,
  });

/** 用户列表 */
export const GetUserList = payload =>
  request({
    url: '/committee/org/getManager/'+ payload,
    method: 'get',
  });
/** 用户列表 */
export const GetUserList1 = payload =>
  request({
    url: '/committee/org/getstudentmanager/'+ payload,
    method: 'get',
  });
/** 场地列表 */
export const getPlaceList = () =>
  request({
    url: '/committee/site/list',
    method: 'get',
  });
/** 老师 */
export const GetTeacherList = payload =>
  request({
    url: '/committee/userinfo/getTeachermanager/'+ payload,
    method: 'get',
  });

// /** 用户列表 */
// export const GetUserList = payload =>
//   request({
//     url: '/committee/userinfo/list',
//     method: 'get',
//     params: payload,
//   });

/** 活动详情 */
export const GetActivityDetail = activityId =>
  request({
    url: `/committee/activity/${activityId}`,
    method: 'get',
    params: { activityId },
  });

/** 活动成员列表 */
export const GetActivityMemberList = payload =>
  request({
    url: '/committee/activityMember/list2',
    method: 'get',
    params: payload,
  });
/** 活动成员列表 */
// export const GetActivityMemberLists = payload =>
//   request({
//     url: '/committee/activityMember/noSign',
//     method: 'get',
//     params: payload,
//   });

/** 活动代签到签退 */
export const ActivityReplaceSign = payload =>
  request({
    url: '/committee/activityMember/signIn/' +payload,
    method: 'get'
  });

/** 学生作品列表 */
export const GetActivityCancelApplyList = payload =>
  request({
    url: '/committee/activityOrganize/list',
    method: 'get',
    params: payload,
  });

export const actActivity = payload =>
  request({
    url: '/committee/activityOrganize/updateStatus',
    method: 'post',
    data: payload,
  });
export const actInfo = payload =>
  request({
    url: '/committee/activityWorks/list/' +payload,
    method: 'get',
  });

/** 创建活动 */
export const CreateActivity = payload =>
  request({
    url: '/committee/activity',
    method: 'post',
    data: payload,
  });
/** 修改活动 */
export const EditActivity = payload =>
  request({
    url: '/committee/activity',
    method: 'put',
    data: payload,
  });
/** 审核活动 */
export const checkActivity = payload =>
  request({
    url: '/committee/activity/examine',
    method: 'post',
    data: payload,
  });

/** 置顶活动 */
export const ToggleTopActivity = activityId =>
  request({
    url: `/committee/activity/toggleTop/${activityId}`,
    method: 'put',
    data: { activityId },
  });

/** 删除活动 */
export const deleteActivity = activityId =>
  request({
    url: `/committee/activity/single/${activityId}`,
    method: 'delete',
    data: { activityId },
  });

// 上传学生作品
export const addFile = data =>
  request({
    url: '/committee/activityWorks/upload',
    method: 'post',
    data: data,
});

// 显示二维码
export function showQrCode(activityId) {
  return request({
    url: '/committee/activity/showQrCode?activityId='+activityId,
    method: 'get',
  })
}
// 显示签到二维码
export function scanningQrCode(activityId,role) {
  return request({
    url: '/wechat/scanningCode/showQrCode?activityId=' + activityId + '&role='+ role,
    method: 'get',
  })
}

//下载图片
export function downloadImgs(params) {
  return request({
    url: '/common/download/url',//后端自定义的下载接口/common/download/url，路径为admin模块的com.ruoyi.web.controller.common;
    responseType: 'blob', //设置后端返回类型为二进制流，不设置会返回乱码
    method: 'get',
    params
  })
}
// 查询组织信息列表
export function listOrg(query) {
  return request({
    url: '/committee/org/list',
    method: 'get',
    params: query
  })
}
// 查询组织信息列表
export function listOrg3(query) {
  return request({
    url: '/committee/org/list2',
    method: 'get',
    params: query
  })
}

// 增加活动最大报名人数
export const addActs = payload =>
  request({
    url: '/committee/activity/editActivity',
    method: 'put',
    data: payload,
  });

